﻿using System;
using System.ComponentModel;
using DBService;

namespace YArchitech.Revit.MEP.Opening
{
	public class BoxParameter
	{
		[Category("属性")]
		[Description("截面参数1。矩形截面此参数表示上边距,圆形截面此参数表示截面直径")]
		[DisplayName("截面参数1")]
		public double Parameter1 { get; set; }

		[Category("属性")]
		[Description("截面参数2。矩形截面此参数表示下边距,圆形截面此参数无意义")]
		[DisplayName("截面参数2")]
		public double Parameter2 { get; set; }

		[Category("属性")]
		[Description("截面参数3。矩形截面此参数表示左边距,圆形截面此参数无意义")]
		[DisplayName("截面参数2")]
		public double Parameter3 { get; set; }

		[Category("属性")]
		[Description("截面参数4。矩形截面此参数表示右边距,圆形截面此参数无意义")]
		[DisplayName("截面参数2")]
		public double Parameter4 { get; set; }

		[Category("属性")]
		[Description("截面类型")]
		[DisplayName("截面类型")]
		public SectionType SectionType { get; set; }

		public BoxParameter(double param1, double param2, double param3, double param4)
		{
			this.Parameter1 = param1;
			this.Parameter2 = param2;
			this.Parameter3 = param3;
			this.Parameter4 = param4;
			this.SectionType = SectionType.Rect;
		}

		public BoxParameter(double param)
		{
			this.Parameter1 = param;
			this.SectionType = SectionType.Arc;
		}

		public override string ToString()
		{
			string result;
			if (this.SectionType == DBService.SectionType.Arc)
			{
				result = string.Format("{0}", this.Parameter1.ToString());
			}
			else
			{
				result = string.Format("{0}", this.Parameter1.ToString());
			}
			return result;
		}
	}
}
